interface AppState {
  /**
   * 导航栏是否填充
   */
  fillAppHeader: boolean;

  /**
   * 是否展示菜单
   */
  menuIsActive?: boolean
}

function useAppState() {
  const state = useState<AppState>("AppState", () => ({
    fillAppHeader: false,
    menuIsActive: false
  }));

  const initState = shallowRef<AppState>({ ...state.value });

  onUnmounted(() => {
    state.value = initState.value;
  });

  return state;
}

export default useAppState;
